﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="main.aspx.cs" Inherits="OnlineRecruit.main" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style>
         body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }

    header {
        background-color: #333;
        color: white;
        text-align: center;
        padding: 10px 0;
    }
       .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }

    .login-form {
        max-width: 400px;
        width: 100%;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

    input[type="text"],
    input[type="password"],
    select {
        width: 100%;
        padding: 10px;
        margin: 5px 0;
        display: inline-block;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
    }

    button {
        background-color: #007bff;
        color: white;
        padding: 10px 20px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        margin-top: 10px;
    }
    footer {
        background-color: #333;
        color: white;
        text-align: center;
        padding: 10px 0;
        position: fixed;
        bottom: 0;
        width: 100%;
    }
    
    .register-link {
        display: none;
        text-align: center;
        margin-top: 10px;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <header>
    <h1>线上招聘</h1>
</header>
<div class="container">
    <div class="login-form">
        <h2>Login</h2>
        <form action="#" method="post">
            <select name="role" id="role">
                <option value="applicant">应聘者</option>
                <option value="employer">招聘者</option>
                <option value="admin">管理员</option>
            </select>
            <input type="text" name="username" placeholder="Username" />
            <input type="password" name="password" placeholder="Password" />
            <asp:Button Text="登录" runat="server" OnClick="Unnamed1_Click" />               <a href="#"></a>
        </form>
         <div class="register-link" id="registerLink">
            <a href="YingPinsign.aspx" id="registerUrl">现在注册</a>
        </div>
    </div>
</div>


<footer>
    <p>&copy; 2024 在线招聘网. 版权所有</p>
</footer>

    </form>
<script>
    const roleSelect = document.getElementById('role');
    const registerLink = document.getElementById('registerLink');
    const registerUrl = document.getElementById('registerUrl');

    function updateRegisterLink() {
        if (roleSelect.value === 'applicant') {
            registerUrl.href = 'YingPinsign.aspx';
            registerLink.style.display = 'block';
        } else if (roleSelect.value === 'employer') {
            registerUrl.href = 'Qiyezhuce.aspx';
            registerLink.style.display = 'block';
        } else {
            registerLink.style.display = 'none';
        }
    }

    roleSelect.addEventListener('change', updateRegisterLink);

    // Initial check on page load
    updateRegisterLink();
</script>
</body>
</html>
